package com.cafe.case2.service;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.json.JSONUtil;
import com.cafe.case2.dto.OrderInfoDto;
import com.cafe.case2.entity.OrderInfo;
import org.springframework.beans.BeanUtils;

/**
 * @author Cafe
 * 2024/6/19 21:03
 */
public class OrderInfoSendService {

    public void sendOrder(OrderInfo orderInfo) {
        OrderInfoDto orderInfoDto = new OrderInfoDto();
        BeanUtils.copyProperties(orderInfo, orderInfoDto);
        System.out.println(JSONUtil.toJsonStr(orderInfoDto));
        //send orderInfoDto
        //...............
    }





    public void sendOrder2(OrderInfo orderInfo) {
        OrderInfoDto orderInfoDto = new OrderInfoDto();
        BeanUtil.copyProperties(orderInfo, orderInfoDto);
        System.out.println(JSONUtil.toJsonStr(orderInfoDto));
        //send orderInfoDto
        //...............
    }




    public void sendOrder3(OrderInfo orderInfo) {
        OrderInfoDto orderInfoDto = new OrderInfoDto();
        orderInfoDto.setId(orderInfo.getId());
        orderInfoDto.setLogisticsStatus(orderInfo.getLogisticsStatus().toString());
        System.out.println(JSONUtil.toJsonStr(orderInfoDto));
        //send orderInfoDto
        //...............
    }








    /**
     * 修复 0619 bug
     * @param orderInfo
     */
    public void bugFix(OrderInfo orderInfo) {
        System.out.println("修复了一些bug");
    }


}
